<%@ page contentType="text/html; charset=euc-kr" %>
<%@ page import="java.util.*,mvc.Model.Bbs.*,org.json.simple.*"%>
<jsp:useBean id="mgr" class="mvc.Model.Bbs.BbsCMTDataMgr" />
<%
	Map map = new HashMap();
	map.put("bbs_code", request.getParameter("bbs_code"));
	map.put("b_seq", request.getParameter("b_seq"));
	
	int cmt_cnt = 0;
	cmt_cnt = mgr.getCount(map);
	
	List cmt_list = mgr.list(map);
	Iterator iter = cmt_list.iterator();
	
	JSONObject jobj = new JSONObject();
	jobj.put("code","success");
	jobj.put("cmt_cnt",cmt_cnt);
	
	JSONArray jarray = new JSONArray();
	while(iter.hasNext()){
		BbsCMTDataDTO dto = (BbsCMTDataDTO)iter.next();
		jarray.add(dto.toJSONObject());
        jobj.put("data",jarray);
	}
	out.print(jobj);
%>
